package com.thoughtworks.mail;

import com.thoughtworks.utils.InputMasking;

import java.util.List;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: Apr 30, 2009
 * Time: 10:49:19 AM
 * To change this template use File | Settings | File Templates.
 */
public class MailReaderThread implements Runnable {
    private static final String SERVER_NAME = "bjnotes01/ThoughtWorks";
    private static final String DB_NAME = "mail/hrong.nsf";
    private  String PASSWORD = "";

    public MailReaderThread(String password) {
        this.PASSWORD=password;
    }

    public void run() {
        MailReader mailReader= MailReader.getInstance();

        List<Mail> mails = null;
        try {
            mails = mailReader.getMails(SERVER_NAME, DB_NAME, PASSWORD);
        } catch (Exception e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }

        for(Mail mail:mails){
            System.out.println(mail.toString());
        }
    }
}
